package com.ipad.net.apistore;

import com.ipad.net.entity.LoginEntity;
import com.ipad.net.entity.UserInfo;
import com.ipad.net.entity.WarehouseList;

import io.reactivex.Flowable;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Created by Administrator on 2018/12/4.
 */

public interface UserApi {

    @FormUrlEncoded
    @POST("/sys/login")
    Flowable<LoginEntity> login(@Field("username") String username, @Field("password") String password);

    //获取用户信息
    @GET("/sys/user/info")
    Flowable<UserInfo> getUserInfo(@Query("token") String token);

    //获取库房列表
    @FormUrlEncoded
    @POST("/store/warehouse/listUserWarehouse")
    Flowable<Object> getUserWarehouseList(@Field("token") String token,
                                          @Field("userId") String userId);

    //获取库房列表
//    @FormUrlEncoded
    @GET("/store/warehouse/select/{type}")
    Flowable<WarehouseList> getUserWarehouseList(@Path("type")String type,
                                                 @Query("token") String token,
                                                 @Query("pageNumber") String pageNumber,
                                                 @Query("pageSize") String pageSize,
                                                 @Query("name") String name);
}
